package com.drone.drone_server.controller;

import com.drone.drone_server.api.ApiResponse;
import com.drone.drone_server.dao.FireVideoDao;
import com.drone.drone_server.entity.FireVideo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private FireVideoDao fireVideoDao;


    @GetMapping("/test1")
    public ApiResponse test1() {
        System.out.println("test1正常工作");
        return ApiResponse.success("test1正常工作");
        

    }

    @GetMapping("/test2")
    public ApiResponse test2() {
        System.out.println("test2正常工作");
        for(FireVideo fireVideo:fireVideoDao.selectByFireLevel("unprocessed")){
            System.out.println(fireVideo);
        }
        return ApiResponse.success("test2正常工作");


    }
}
